local anran = fk.CreateSkill{
  name = "lingling__anran",
}

Fk:loadTranslationTable{
  ["lingling__anran"] = "黯然",
  [":lingling__anran"] = "每轮限两次，你可以将锦囊牌当【酒】使用并摸一张牌。",

  ["#lingling__anran"] = "黯然：你可以将锦囊牌当【酒】使用并摸一张牌",
}

anran:addEffect("viewas", {
  anim_type = "support",
  pattern = "analeptic",
  prompt = "#lingling__anran",
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeTrick
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 then return end
    local card = Fk:cloneCard("analeptic")
    card.skillName = anran.name
    card:addSubcard(cards[1])
    return card
  end,
  after_use = function (self, player, use)
    if not player.dead then
      player:drawCards(1, anran.name)
    end
  end,
  enabled_at_play = function (self, player)
    return player:usedSkillTimes(anran.name, Player.HistoryRound) < 2
  end,
  enabled_at_response = function(self, player, response)
    return not response and player:usedSkillTimes(anran.name, Player.HistoryRound) < 2
  end,
})

return anran
